import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { BusiProvider } from '../../providers/busi/busi';
import { Global } from '../../common/global';

/**
 * Generated class for the ProductshPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-productsh',
  templateUrl: 'productsh.html',
})
export class ProductshPage {
  prodinfo:any;
  constructor(public navCtrl: NavController, public navParams: NavParams,public busi:BusiProvider) {

  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad ProductshPage');
  }
  ionViewDidEnter(){
    this.getProductWsh();
  }

  getProductWsh(){
    this.busi.getProductWsh().subscribe(
      data=>{
        this.prodinfo = data.prodinfo;
      },error=>{

      }
    );
  }

  productdetail(prodid){
    this.navCtrl.push("ProductdetailPage",{prodid:prodid});
  }

  getImageUrl(url ){
    return Global.base_url + url;
  }

}
